package com.sword.pay.alipay.domain.config;


import com.sword.pay.PayManager;
import com.sword.pay.bean.enums.ChannelPayEnum;

/**
 * @description: 支付宝支连接客户端
 * @author：Lv.RJ
 * @version: 1.0.0
 * @create: 2025/02/18
 **/
public class AliPayConfigManager {

	/**
	 * 获取当前线程中的 AliPayApiConfig
	 *
	 * @return {@link AliPayConfig}
	 */
	public static AliPayConfig getAliPayApiConfig() {
		AliPayConfig beanConfig = PayManager.getBeanConfig(ChannelPayEnum.ALIPAY, AliPayConfig.class);
		if (beanConfig == null) {
			throw new IllegalStateException("需事先将 appId对应的 aliPayApiConfig 对象存入");
		}
		return beanConfig;
	}
}
